//
//  BTEBaseTableViewController.swift
//  BTE
//
//  Created by Mike Zhang on 2025/8/18.
//

import UIKit

class BTEBaseTableViewController: UITableView {

    // MARK: - Initializer

    override init(frame: CGRect, style: UITableView.Style) {
        super.init(frame: frame, style: style)
        configureDefaults()
    }

    required init?(coder: NSCoder) {
        super.init(coder: coder)
        configureDefaults()
    }

    // MARK: - Configuration

    private func configureDefaults() {
        if #available(iOS 11.0, *) {
            contentInsetAdjustmentBehavior = .never
            estimatedSectionHeaderHeight = 0
            estimatedSectionFooterHeight = 0
            scrollIndicatorInsets = contentInset
        }

        estimatedRowHeight = 44
        rowHeight = UITableView.automaticDimension
        separatorStyle = .none
        showsVerticalScrollIndicator = false
        sectionHeaderHeight = 0
        sectionFooterHeight = 0

        if #available(iOS 15.0, *) {
            sectionHeaderTopPadding = 0
        }
    }
}
